<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>21_定位-特殊情况1</title>

        <style>
            /* 下面的定位元素 会覆盖上面的定位元素 */
            /* #d1 {
                position: absolute;
                width: 600px;
                height: 600px;
                border: 20px solid black;
                background-color: red;
            }

            #d3 {
                position: absolute;
                width: 400px;
                height: 200px;
                border: 20px solid yellow;
                background-color: green;
            } */

            /* 元素的显示层级受到父元素的显示层级的影响
            不管子元素的县市层级是如果 必须收到父元素的显示层级的影响
            */

            #d1 {
                position: absolute;
                z-index: 5;
                width: 600px;
                height: 600px;
                background-color: red;
            }

            #d2 {
                position: absolute;
                z-index: 3;
                width: 200px;
                height: 300px;
                background-color: skyblue;
            }

            #d3 {
                position: absolute;
                z-index: 4;
                width: 800px;
                height: 200px;
                background-color: green;
            }
        </style>

    </head>
    <body>
        <div id="d1">
            <div id="d2"></div>
        </div>

        <div id="d3"></div>
    </body>
</html>